home *** CD-ROM | disk | FTP | other *** search
- Path: dialup-24.melbpc.org.au!dward
- From: dward@melbpc.org.au (Darren Ward)
- Newsgroups: comp.lang.c
- Subject: Probs with prototype mixes with Functions
- Date: Sat, 20 Apr 1996 12:21:08 UTC+10
- Organization: Melbourne PC User Group, Australia
- Message-ID: <dward.1.000DC9CA@melbpc.org.au>
- NNTP-Posting-Host: dialup-24.melbpc.org.au
- Keywords: function
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
-
- Could anyone help me with the following?
-
- when making a function such as:
-
- float convert(int celcius)
- {
- float faranheit;
- faranheit = ((float)celcius*9/5)+32;
- return faranheit;
- }
-
- and it is called by the main program as
-
-
- faran = convert(celc);
-
- where faran is a float and celc is an int.
-
-
- The problem is that I can't compile it as it keeps giving me errors on return
- type but as far as I can see the main is waiting for a float and the function
- should return a float?
-
- Any help would be greatly appreciated.
-
- Darren
- ,-._|\ Darren Ward Limit to about 76 cols->
- / Oz \ Mail Address, Phone, Fax. Member, Melbourne PC User Group.
- \_,--.x/ Edit/replace text but don't exceed 4 lines as per netiquette.
- v ++++ Fancy borders count as a line ~~~~~~~~~~-----++++++++++
-